#include "graph.c"
#include <stdlib.h>
#include <stdio.h>

void PrintOrder(int TopNum[], int N)
{
	int i;

	printf("Toport: ");
	for (i=1; i <=N; i++)
		printf("%4d", TopNum[i]);//printf("%4d", ____________);
	return;
}


void main() {
	int N;
	Graph G;
	int *TopNum;
	char s[8];

	G = CreateDirectGraph();
	N = NumOfVex(G);
	TopNum = (int *)malloc(sizeof(int) * (N + 1));
	if (Topsort(G, TopNum))
		PrintOrder(TopNum, N);
	else
		printf("There is a cycle in graph\n");
	scanf("%s", s);
	return;
}







